package org.jinion.constants;

public enum OperatorEnum {
	equal(0,"="),unequal(1,"<>"),greaterThan(2,">"),lessThan(3,"<"),greaterEqual(4,">="),lessEqual(5,"<="),
	like(6,"LIKE"),logicalAnd(7,"AND"),logicalOr(8,"OR"),asc(9,"ASC"),desc(10,"DESC"),unsupport(-1,"");

	private int value;
	private String label;
	OperatorEnum(int value, String label) {
		this.value = value;
		this.label = label;
	}
	public int getValue() {
		return value;
	}
	public String getLabel() {
		return label;
	}
	public static String matchComparator(OperatorEnum oper) {
		for(OperatorEnum operator : OperatorEnum.values()) {
			if(oper.getValue() == operator.getValue()) {
				return operator.getLabel();
			}
		}
		return OperatorEnum.unsupport.getLabel();
	}
}
